package com.ruoyi.service.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.service.mapper.ServiceNoticeMapper;
import com.ruoyi.service.domain.ServiceNotice;
import com.ruoyi.service.service.IServiceNoticeService;

/**
 * 通知公告Service业务层处理
 * 
 * @author yepanpan
 * @date 2025-05-06
 */
@Service
public class ServiceNoticeServiceImpl implements IServiceNoticeService 
{
    private static final Logger log = LoggerFactory.getLogger(ServiceNoticeServiceImpl.class);

    @Autowired
    private ServiceNoticeMapper serviceNoticeMapper;

    /**
     * 查询通知公告
     * 
     * @param id 通知公告主键
     * @return 通知公告
     */
    @Override
    public ServiceNotice selectServiceNoticeById(Long id)
    {
        return serviceNoticeMapper.selectServiceNoticeById(id);
    }

    /**
     * 查询通知公告列表
     * 
     * @param serviceNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<ServiceNotice> selectServiceNoticeList(ServiceNotice serviceNotice)
    {
        return serviceNoticeMapper.selectServiceNoticeList(serviceNotice);
    }

    /**
     * 新增通知公告
     * 
     * @param serviceNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertServiceNotice(ServiceNotice serviceNotice)
    {
        serviceNotice.setCreateTime(DateUtils.getNowDate());
        return serviceNoticeMapper.insertServiceNotice(serviceNotice);
    }

    /**
     * 修改通知公告
     * 
     * @param serviceNotice 通知公告
     * @return 结果
     */
    @Override
    public int updateServiceNotice(ServiceNotice serviceNotice)
    {
        serviceNotice.setUpdateTime(DateUtils.getNowDate());
        return serviceNoticeMapper.updateServiceNotice(serviceNotice);
    }

    /**
     * 批量删除通知公告
     * 
     * @param ids 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteServiceNoticeByIds(Long[] ids)
    {
        return serviceNoticeMapper.deleteServiceNoticeByIds(ids);
    }

    /**
     * 删除通知公告信息
     * 
     * @param id 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteServiceNoticeById(Long id)
    {
        return serviceNoticeMapper.deleteServiceNoticeById(id);
    }


}
